Skip to content

fix: guard null selected item during item tool placement#229

Merged
open-pascal merged 1 commit intomainfrom
fix/item-tool-null-asset-guard
Apr 14, 2026
Merged

fix: guard null selected item during item tool placement#229
open-pascal merged 1 commit intomainfrom
fix/item-tool-null-asset-guard

Conversation

@open-pascal
Copy link
Copy Markdown
Collaborator

Summary

  • allow the item placement coordinator to receive a nullable asset
  • bail out early in the placement effects/frame loop when no asset is selected
  • remove the non-null assertions in item-tool.tsx

Why

This ports the recent monorepo fix from Anton (174246fb, fix(editor): guard null asset in usePlacementCoordinator).

The OSS editor still had the older partial guard, but it was still assuming selectedItem! in item-tool.tsx and still running placement coordinator effects/frames when the asset was null. That can happen during transient tool activation or scene updates and can cascade into render failures.

Verification

  • npx -y @biomejs/biome check packages/editor/src/components/tools/item/item-tool.tsx packages/editor/src/components/tools/item/use-placement-coordinator.tsx
  • npx -y react-doctor@latest . --verbose --diff (packages/editor scored 99/100, warning-only on pre-existing unknown properties in use-placement-coordinator.tsx)

@open-pascal open-pascal merged commit cf74939 into main Apr 14, 2026
1 check passed
@open-pascal open-pascal deleted the fix/item-tool-null-asset-guard branch April 14, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant